package net.cyndeline.components.world

import net.cyndeline.entitySystem.Component

/**
 * Gives a name to an entity. This name does not have to be
 * unique, and cannot be used as id.
 */
trait NameComponent extends Component {
  
  /** A name. */
  def name: String
  
  /** Sets a new name. */
  def name_=(newName: String)
}

class Name extends NameComponent {
  override var name: String = "<default name>"
    
  override def copy = {
    val copy = new Name()
    copy.name = name
    copy
  }
}